<template>
	<treegrid :columns="treeColumn"        
	:tree-structure = "true" :data-source = "treeData" :defaultExpandAll="true" :filter-change = "filterChange" 
	>
		<template slot-scope="scope" slot="rstate">
			<span  v-show="scope.scope.row.type == 'file' || scope.scope.row.type == 'kbid' ">{{scope.scope.row.rstate == 1?"正在处理":scope.scope.row.rstate == 2?'已完成': scope.scope.row.rstate == null ? "未处理" : "终止"}}</span>
		</template>
	</treegrid>
</template>

<script>
	export default{
		data(){
			return{
				treeData: [
					{
					"node_name": "节点1", 
					"type": "node", 
					"id": 1, 
					"children": [{
								"type": "node", 
								"children": [{
									"type": "client", 
									"children": [{
										"children": [], 
										"rstate": 1, 
										'type': "file",
										"node_name": "Virus/MSWord.Marker.r", 
										"mdeal_result": "误报"}], 
									"node_name": "10.255.83.103(节点3)"}],
								"node_name": "节点2"}]}
				],
				treeColumn:[{
					text: '资产',
					dataIndex: 'node_name'
				},{
					text:"状态",
					dataIndex:'rstate',
					filters:[{ text: '正在处理', value: '1' }, { text: '已完成', value: '2' }],
					treeKey:"rstate",
					ifCustom:true,
					width:"150"
				},{
					text:"结果",
					dataIndex:'mdeal_result',
					filters:[{ text: '修复成功', value: '修复成功' }, { text: '修复失败', value: '修复失败' }],
					treeKey:"mdeal_result",
					width:"150"
				}],
			}
		},
		methods:{
			filterChange(){
				console.log("filterChange")
			}
		}
	}
</script>
<style>
	
</style>